home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / message / msgbox2 / frmprevc.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-14  |  6.2 KB  |  172 lines

  1. VERSION 2.00
  2. Begin Form frmPrevCode 
  3.    Caption         =   "Code Preview"
  4.    ClientHeight    =   4176
  5.    ClientLeft      =   1380
  6.    ClientTop       =   1608
  7.    ClientWidth     =   5172
  8.    Height          =   4548
  9.    Left            =   1332
  10.    LinkTopic       =   "Form1"
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4176
  13.    ScaleWidth      =   5172
  14.    Top             =   1284
  15.    Width           =   5268
  16.    Begin SSPanel panStatBar 
  17.       Align           =   1  'Align Top
  18.       BackColor       =   &H00C0C0C0&
  19.       Font3D          =   0  'None
  20.       Height          =   372
  21.       Left            =   0
  22.       TabIndex        =   1
  23.       Top             =   0
  24.       Width           =   5172
  25.       Begin SSRibbon gpbToolBar 
  26.          BackColor       =   &H00C0C0C0&
  27.          BevelWidth      =   0
  28.          Height          =   264
  29.          Index           =   3
  30.          Left            =   1140
  31.          Outline         =   0   'False
  32.          PictureDn       =   FRMPREVC.FRX:0000
  33.          PictureDnChange =   1  'Dither 'PictureUp' Bitmap
  34.          PictureUp       =   FRMPREVC.FRX:0182
  35.          RoundedCorners  =   0   'False
  36.          Top             =   60
  37.          Width           =   288
  38.       End
  39.       Begin SSRibbon GroupPush3D2 
  40.          BackColor       =   &H00C0C0C0&
  41.          BevelWidth      =   0
  42.          Height          =   252
  43.          Left            =   1920
  44.          Outline         =   0   'False
  45.          PictureDnChange =   1  'Dither 'PictureUp' Bitmap
  46.          RoundedCorners  =   0   'False
  47.          Top             =   60
  48.          Width           =   372
  49.       End
  50.       Begin SSRibbon gpbToolBar 
  51.          BackColor       =   &H00C0C0C0&
  52.          BevelWidth      =   0
  53.          Height          =   264
  54.          Index           =   2
  55.          Left            =   696
  56.          Outline         =   0   'False
  57.          PictureDn       =   FRMPREVC.FRX:0304
  58.          PictureDnChange =   1  'Dither 'PictureUp' Bitmap
  59.          PictureUp       =   FRMPREVC.FRX:0486
  60.          RoundedCorners  =   0   'False
  61.          Top             =   60
  62.          Width           =   288
  63.       End
  64.       Begin SSRibbon gpbToolBar 
  65.          BackColor       =   &H00C0C0C0&
  66.          BevelWidth      =   0
  67.          Height          =   264
  68.          Index           =   1
  69.          Left            =   408
  70.          Outline         =   0   'False
  71.          PictureDn       =   FRMPREVC.FRX:0608
  72.          PictureDnChange =   1  'Dither 'PictureUp' Bitmap
  73.          PictureUp       =   FRMPREVC.FRX:078A
  74.          RoundedCorners  =   0   'False
  75.          Top             =   60
  76.          Width           =   288
  77.       End
  78.       Begin SSRibbon gpbToolBar 
  79.          BackColor       =   &H00C0C0C0&
  80.          BevelWidth      =   0
  81.          Height          =   264
  82.          Index           =   0
  83.          Left            =   120
  84.          Outline         =   0   'False
  85.          PictureDn       =   FRMPREVC.FRX:090C
  86.          PictureDnChange =   1  'Dither 'PictureUp' Bitmap
  87.          PictureUp       =   FRMPREVC.FRX:0A8E
  88.          RoundedCorners  =   0   'False
  89.          Top             =   60
  90.          Width           =   288
  91.       End
  92.    End
  93.    Begin TextBox txtCodeView 
  94.       Height          =   3672
  95.       Left            =   60
  96.       MultiLine       =   -1  'True
  97.       ScrollBars      =   2  'Vertical
  98.       TabIndex        =   0
  99.       Text            =   "Text1"
  100.       Top             =   420
  101.       Width           =   4752
  102.    End
  103. Option Explicit
  104. Sub Form_Load ()
  105.   Dim pstrMsgBoxIni As String
  106.   Dim pstrTemp As String
  107.   Dim pintTop As Integer
  108.   Dim pintLeft As Integer
  109.   Dim pintWidth As Integer
  110.   Dim pintHeight As Integer
  111.   screen.MousePointer = 11
  112.   ' Setup the tool bar for deffrent screen sizes
  113.   panStatBar.Height = gpbToolBar(0).Height + 120
  114.   ' Get the app's ini file and location
  115.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  116.   ' Place and size form according to what is in the ini file
  117.   ' If no info in the ini file center form on MsgBxGen form
  118.   pstrTemp = ReadIni("Code Preview", "Width", "No", pstrMsgBoxIni)
  119.   If pstrTemp = "No" Then
  120.     Call CenterOnForm(MsgBxGen, frmPrevCode)
  121.   Else
  122.     pintWidth = Val(pstrTemp)
  123.     pintHeight = Val(ReadIni("Code Preview", "Height", Str(screen.Height / 2), pstrMsgBoxIni))
  124.     Me.Width = pintWidth
  125.     Me.Height = pintHeight
  126.     pintTop = Val(ReadIni("Code Preview", "Top", Str((screen.Height - Me.Height) / 2), pstrMsgBoxIni))
  127.     pintLeft = Val(ReadIni("Code Preview", "Left", Str((screen.Width - Me.Width) / 2), pstrMsgBoxIni))
  128.     Me.Move pintLeft, pintTop
  129.   End If
  130.   screen.MousePointer = 0
  131. End Sub
  132. Sub Form_Resize ()
  133.   txtCodeView.Move 0, panStatBar.Height, frmPrevCode.ScaleWidth, frmPrevCode.ScaleHeight - panStatBar.Height
  134. End Sub
  135. Sub Form_Unload (Cancel As Integer)
  136.   Dim pstrMsgBoxIni As String
  137.   ' Get the app's ini file and location
  138.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  139.   ' Save size and pos info
  140.   Call SaveIni("Code Preview", "Top", Trim(Str(Me.Top)), pstrMsgBoxIni)
  141.   Call SaveIni("Code Preview", "Left", Trim(Str(Me.Left)), pstrMsgBoxIni)
  142.   Call SaveIni("Code Preview", "Height", Trim(Str(Me.Height)), pstrMsgBoxIni)
  143.   Call SaveIni("Code Preview", "Width", Trim(Str(Me.Width)), pstrMsgBoxIni)
  144. End Sub
  145. Sub gpbToolBar_Click (Index As Integer, Value As Integer)
  146.   If Value = 0 Then   ' If button down
  147.     Select Case Index
  148.       Case 0    ' Cut
  149.         ' If nothing selected do not cleer clipboard
  150.         If txtCodeView.SelText <> "" Then
  151.           ' Copy selected text to Clipboard.
  152.           ClipBoard.SetText txtCodeView.SelText
  153.           ' Delete selected text.
  154.           txtCodeView.SelText = ""
  155.         End If
  156.       Case 1    ' Copy
  157.         ' If nothing selected do not cleer clipboard
  158.         If txtCodeView.SelText <> "" Then
  159.           ' Copy selected text to Clipboard.
  160.           ClipBoard.SetText txtCodeView.SelText
  161.         End If
  162.       Case 2    ' Paste
  163.         ' Place text from Clipboard into active control.
  164.         txtCodeView.SelText = ClipBoard.GetText()
  165.       Case 3    ' Close
  166.         Me.Hide
  167.     End Select
  168.   Else
  169.     gpbToolBar(Index).Value = 0
  170.   End If
  171. End Sub
  172.